<?php if (! isset($show_content)) $show_content = false; ?>

<div class="post">
    <div class="p-head">
      <?php 
      if ($show_content)
        echo '<h1>',CHtml::link($data->title, '#'),'</h1>';
      else
        echo '<h3>',CHtml::link($data->title, url('view', array('id' => $data->id))),'</h3>';
      ?>
      
      <p class="p-date-cat">
        <?php echo Yii::app()->getDateFormatter()->formatDateTime($data->update_time); ?> |
        In: <?php echo CHtml::link($data->category->title, url('category', array('category_id' => $data->category_id)))?>
      </p>
    </div>

    <div class="p-con">
        <?php echo $data->leading_text?>
        <?php if ($show_content) echo $data->content;?>
    </div>

    <?php if (! $show_content) : ?>
        <ul class="p-det">
          <li class="p-det-com"><?php echo CHtml::link('Comments', url('view', array('id' => $data->id))) ?></li>

          <li class="p-det-more"><?php echo CHtml::link('More', url('view', array('id' => $data->id))) ?></li>
        </ul>
    <?php endif;?>
  </div>